######################################################################
## The follow is the replication code for:
##
## Christopher Adolph, Caitlin Ainsley, and Asli Cansunar,
## Forthcoming, "Irregularities in Perez Brower (2024),
## 'Reframing Gendered Issues: Intersectional Identity Frames
## and Policy Agendas,'" Political Behavior.
##
## Christopher Adolph, Caitlin Ainsley, and Asli Cansunar
## 3 March 2026
##
######################################################################
##
## The script below constitutes the minimal code needed
## to replicate and/or correct the main results from:
##
## Margaret Perez Brower, 2024, "Reframing gendered issues:
## Intersectional identity frames and policy agendas."
## Political Behavior 46. 331--353.
##
## This script requires the data from gf_clean.csv, which as
## of 24 April 2025 is hosted at:
## https://www.margaretbrower.com/s/gf_clean.csv
##
## The first part of this script consists of the required processing code
## from Perez Brower's own replication script, with extraneous code
## removed. This is taken from the replication code linked in
## Perez Brower (2024), available as of 24 April 2025 at:
## https://www.margaretbrower.com/s/POBE-Final-R-Script.R
##
## The second part of this script is original code to replicate
## Perez Brower's analysis
##
## The third part of this script is original code to produce
## the new results in our Tables 7 and 8

#########################################################################
## Minimal required data processing code from author's replication script

## lines 1-7 of original script
#Clear dataset
rm(list=ls())

#Libraries
library (tidyverse)
library(readr)
library(dplyr)

## lines 23-24 of original script
#Download clean dataset 
gf <- read_csv("gf_clean.csv")

## lines 43-44 of original script
#Count Variable 
gf <-mutate(gf, participate.agg= (protest + petition + org + socialmedia 
+ discuss + vote + candidate))

## lines 149-179 of original script
#Individal data frames for sexual harassment treatments
#Control 
sh_control <- subset(gf, gf$shc== 1)

#Treatment 6: white woman/white collar
sh_white_highinc <- subset(gf, gf$sh_white_highinc== 1)

#Treatment 7: minority woman/ white collar
sh_minority_highinc <- subset(gf, gf$sh_minority_highinc== 1)

#Treatment 8: white woman/ blue collar
sh_white_lowinc <- subset(gf, gf$sh_white_lowinc== 1)

#Treatment 9: minority woman/ blue collar
sh_minority_lowinc <- subset(gf, gf$sh_minority_lowinc== 1)

#Dummy variables for Gender Gap Treatments
#Control
gg_control<- subset(gf, gf$ggc== 1)

#Treatment 1: white woman/ white collar
gg_white_highinc <- subset(gf, gf$gg_white_highinc== 1)

#Treatment 2: minority woman/ white colar
gg_minority_highinc <- subset(gf, gf$gg_minority_highinc== 1)

#Treatment 3: white woman/ blue collar
gg_white_lowinc <- subset(gf, gf$gg_white_lowinc== 1)

#Treatment 4: minority woman/ blue collar
gg_minority_lowinc <- subset(gf, gf$gg_minority_lowinc== 1)


#########################################################################
## All code above is taken from Perez Brower's replication file and
## produces just those data structures needed to replicate and correct
## her main results below using new analysis code. None of the code
## below is taken from Perez Brower. We now replicate her results.

## Code to produce contents of our Table 4 summaring dependent variables
dv1 <- list(sh_control$participate.agg, sh_white_highinc$participate.agg,
             sh_minority_highinc$participate.agg, sh_white_lowinc$participate.agg,
             sh_minority_lowinc$participate.agg, gg_control$participate.agg,
             gg_white_highinc$participate.agg, gg_minority_highinc$participate.agg,
             gg_white_lowinc$participate.agg, gg_minority_lowinc$participate.agg)

noaction <- list(sh_control$noaction, sh_white_highinc$noaction,
                 sh_minority_highinc$noaction, sh_white_lowinc$noaction,
                 sh_minority_lowinc$noaction, gg_control$noaction,
                 gg_white_highinc$noaction, gg_minority_highinc$noaction,
                 gg_white_lowinc$noaction, gg_minority_lowinc$noaction)

neveract <- list(sh_control$neveract, sh_white_highinc$neveract,
                 sh_minority_highinc$neveract, sh_white_lowinc$neveract,
                 sh_minority_lowinc$neveract, gg_control$neveract,
                 gg_white_highinc$neveract, gg_minority_highinc$neveract,
                 gg_white_lowinc$neveract, gg_minority_lowinc$neveract)

n <- sapply(dv1, length)
dv1mean <- sapply(dv1, mean)
dv1positive <- sapply(dv1, function(x){sum(as.numeric(x>0))})
noactionSum <- sapply(noaction, sum)
neveractSum <- sapply(neveract, sum)

dvTable <- cbind(round(dv1mean, digits=3), dv1positive,
                 noactionSum, neveractSum, n)
dvTable <- as.data.frame(dvTable)
dvTable  <- cbind(c("sh_control", "sh_white_highinc", "sh_minority_highinc",
                    "sh_white_lowinc", "sh_minority_lowinc",
                    "gg_control", "gg_white_highinc", "gg_minority_highinc",
                    "gg_white_lowinc", "gg_minority_lowinc"),
                  dvTable)
names(dvTable) <- c("Condition", "dv1Mean", "dv1positive",
                    "noactionSum", "neveractSum", "n")
                  
cor(noactionSum, neveractSum)                  


## Code to produce contents of our Table 1

## Comparison of means: Experiment 1 (Sexual Harassment),
##                      DV 1 (Count of behaviors)
##    Comparing each of four treatments to ambiguous frame
t.test(sh_white_highinc$participate.agg, sh_control$participate.agg)
mean(sh_white_highinc$participate.agg) - mean(sh_control$participate.agg)

t.test(sh_minority_highinc$participate.agg, sh_control$participate.agg)
mean(sh_minority_highinc$participate.agg) - mean(sh_control$participate.agg)

t.test(sh_white_lowinc$participate.agg, sh_control$participate.agg)
mean(sh_white_lowinc$participate.agg) - mean(sh_control$participate.agg)

t.test(sh_minority_lowinc$participate.agg, sh_control$participate.agg)
mean(sh_minority_lowinc$participate.agg) - mean(sh_control$participate.agg)


## Comparison of means: Experiment 1 (Sexual Harassment),
##                      DV 1 (Count of behaviors)
##    Comparing treatments 2, 3, and 4 to treatment 1
t.test(sh_minority_highinc$participate.agg, sh_white_highinc$participate.agg)
mean(sh_minority_highinc$participate.agg) - mean(sh_white_highinc$participate.agg)

t.test(sh_white_lowinc$participate.agg, sh_white_highinc$participate.agg)
mean(sh_white_lowinc$participate.agg) - mean(sh_white_highinc$participate.agg)

t.test(sh_minority_lowinc$participate.agg, sh_white_highinc$participate.agg)
mean(sh_minority_lowinc$participate.agg) - mean(sh_white_highinc$participate.agg)


## Code to produce contents of our Table 2

## Comparison of means: Experiment 2 (Gender Pay Gap),
##                      DV 1 (Count of behaviors)
##    Comparing each of four treatments to ambiguous frame
t.test(gg_white_highinc$participate.agg, gg_control$participate.agg)
mean(gg_white_highinc$participate.agg) - mean(gg_control$participate.agg)

t.test(gg_minority_highinc$participate.agg, gg_control$participate.agg)
mean(gg_minority_highinc$participate.agg) - mean(gg_control$participate.agg)

t.test(gg_white_lowinc$participate.agg, gg_control$participate.agg)
mean(gg_white_lowinc$participate.agg) - mean(gg_control$participate.agg)

t.test(gg_minority_lowinc$participate.agg, gg_control$participate.agg)
mean(gg_minority_lowinc$participate.agg) - mean(gg_control$participate.agg)


## Comparison of means: Experiment 2 (Gender Pay Gap),
##                      DV 1 (Count of behaviors)
##    Comparing treatments 2, 3, and 4 to treatment 1
t.test(gg_minority_highinc$participate.agg, gg_white_highinc$participate.agg)
mean(gg_minority_highinc$participate.agg) - mean(gg_white_highinc$participate.agg)

t.test(gg_white_lowinc$participate.agg, gg_white_highinc$participate.agg)
mean(gg_white_lowinc$participate.agg) - mean(gg_white_highinc$participate.agg)

t.test(gg_minority_lowinc$participate.agg, gg_white_highinc$participate.agg)
mean(gg_minority_lowinc$participate.agg) - mean(gg_white_highinc$participate.agg)


## ## Code to produce contents of our Table 5

## Compute proportions for neveract variable for Experiment 1
NeverActCountsSH <- c(sum(sh_control$neveract),
                      sum(sh_white_highinc$neveract),
                      sum(sh_minority_highinc$neveract),
                      sum(sh_white_lowinc$neveract),
                      sum(sh_minority_lowinc$neveract))
SampleSizesSH <- c(length(sh_control$neveract),
                   length(sh_white_highinc$neveract),
                   length(sh_minority_highinc$neveract),
                   length(sh_white_lowinc$neveract),
                   length(sh_minority_lowinc$neveract))
PctNeverActSH <- NeverActCountsSH/SampleSizesSH*100

## Comparison of means: Experiment 1 (Sexual Harassment),
##                      DV 2 (Proportion "would NOT participate")
##    Comparing each of four treatments to ambiguous frame
t.test(sh_white_highinc$neveract, sh_control$neveract)
100*(mean(sh_white_highinc$neveract) - mean(sh_control$neveract))

t.test(sh_minority_highinc$neveract, sh_control$neveract)
100*(mean(sh_minority_highinc$neveract) - mean(sh_control$neveract))

t.test(sh_white_lowinc$neveract, sh_control$neveract)
100*(mean(sh_white_lowinc$neveract) - mean(sh_control$neveract))

t.test(sh_minority_lowinc$neveract, sh_control$neveract)
100*(mean(sh_minority_lowinc$neveract) - mean(sh_control$neveract))


## Comparison of means: Experiment 1 (Sexual Harassment),
##                      DV 2 (Proportion "would NOT participate")
##    Comparing treatments 2, 3, and 4 to treatment 1
t.test(sh_minority_highinc$neveract, sh_white_highinc$neveract)
100*(mean(sh_minority_highinc$neveract) - mean(sh_white_highinc$neveract))

t.test(sh_white_lowinc$neveract, sh_white_highinc$neveract)
100*(mean(sh_white_lowinc$neveract) - mean(sh_white_highinc$neveract))

t.test(sh_minority_lowinc$neveract, sh_white_highinc$neveract)
100*(mean(sh_minority_lowinc$neveract) - mean(sh_white_highinc$neveract))


## Code to produce contents of our Table 6

## Compute proportions for neveract variable for Experiment 2
NeverActCountsGG <- c(sum(gg_control$neveract),
                      sum(gg_white_highinc$neveract),
                      sum(gg_minority_highinc$neveract),
                      sum(gg_white_lowinc$neveract),
                      sum(gg_minority_lowinc$neveract))
SampleSizesGG <- c(length(gg_control$neveract),
                   length(gg_white_highinc$neveract),
                   length(gg_minority_highinc$neveract),
                   length(gg_white_lowinc$neveract),
                   length(gg_minority_lowinc$neveract))
PctNeverActGG <- NeverActCountsGG/SampleSizesGG*100

## Comparison of means: Experiment 2 (Gender Pay Gap),
##                      DV 2 (Proportion "would NOT participate")
##    Comparing each of four treatments to ambiguous frame
t.test(gg_white_highinc$neveract, gg_control$neveract)
100*(mean(gg_white_highinc$neveract) - mean(gg_control$neveract))

t.test(gg_minority_highinc$neveract, gg_control$neveract)
100*(mean(gg_minority_highinc$neveract) - mean(gg_control$neveract))

t.test(gg_white_lowinc$neveract, gg_control$neveract)
100*(mean(gg_white_lowinc$neveract) - mean(gg_control$neveract))

t.test(gg_minority_lowinc$neveract, gg_control$neveract)
100*(mean(gg_minority_lowinc$neveract) - mean(gg_control$neveract))


## Comparison of means: Experiment 2 (Gender Pay Gap),
##                      DV 2 (Proportion "would NOT participate")
##    Comparing treatments 2, 3, and 4 to treatment 1
t.test(gg_minority_highinc$neveract, gg_white_highinc$neveract)
100*(mean(gg_minority_highinc$neveract) - mean(gg_white_highinc$neveract))

t.test(gg_white_lowinc$neveract, gg_white_highinc$neveract)
100*(mean(gg_white_lowinc$neveract) - mean(gg_white_highinc$neveract))

t.test(gg_minority_lowinc$neveract, gg_white_highinc$neveract)
100*(mean(gg_minority_lowinc$neveract) - mean(gg_white_highinc$neveract))


########################################################################
## Below is code to produce the new results in our Tables 7 and 8

## Code to produce contents of our Table 7

## Compute proportions for neveract + noaction for Experiment 1
NeverNoActCountsSH <- c(sum(sh_control$neveract + sh_control$noaction),
                      sum(sh_white_highinc$neveract + sh_white_highinc$noaction),
                      sum(sh_minority_highinc$neveract + sh_minority_highinc$noaction),
                      sum(sh_white_lowinc$neveract + sh_white_lowinc$noaction),
                      sum(sh_minority_lowinc$neveract + sh_minority_lowinc$noaction))
SampleSizesSH <- c(length(sh_control$neveract + sh_control$noaction),
                   length(sh_white_highinc$neveract + sh_white_highinc$noaction),
                   length(sh_minority_highinc$neveract + sh_minority_highinc$noaction),
                   length(sh_white_lowinc$neveract + sh_white_lowinc$noaction),
                   length(sh_minority_lowinc$neveract + sh_minority_lowinc$noaction))
PctNeverNoActSH <- NeverNoActCountsSH/SampleSizesSH*100

## Comparison of means: Experiment 1 (Sexual Harassment),
##   DV: Proportion "would NOT participate" + proportion "none of the above"
##    Comparing each of four treatments to ambiguous frame
t.test(sh_white_highinc$neveract + sh_white_highinc$noaction,
       sh_control$neveract + sh_control$noaction)
100*(mean(sh_white_highinc$neveract + sh_white_highinc$noaction)
    - mean(sh_control$neveract + sh_control$noaction))

t.test(sh_minority_highinc$neveract + sh_minority_highinc$noaction,
       sh_control$neveract + sh_control$noaction)
100*(mean(sh_minority_highinc$neveract + sh_minority_highinc$noaction)
    - mean(sh_control$neveract + sh_control$noaction))

t.test(sh_white_lowinc$neveract + sh_white_lowinc$noaction,
       sh_control$neveract + sh_control$noaction)
100*(mean(sh_white_lowinc$neveract + sh_white_lowinc$noaction)
    - mean(sh_control$neveract + sh_control$noaction))

t.test(sh_minority_lowinc$neveract + sh_minority_lowinc$noaction,
       sh_control$neveract + sh_control$noaction)
100*(mean(sh_minority_lowinc$neveract + sh_minority_lowinc$noaction)
    - mean(sh_control$neveract + sh_control$noaction))


## Comparison of means: Experiment 1 (Sexual Harassment),
##   DV: Proportion "would NOT participate" + proportion "none of the above"
##    Comparing treatments 2, 3, and 4 to treatment 1
t.test(sh_minority_highinc$neveract + sh_minority_highinc$noaction,
       sh_white_highinc$neveract + sh_white_highinc$noaction)
100*(mean(sh_minority_highinc$neveract + sh_minority_highinc$noaction)
    - mean(sh_white_highinc$neveract + sh_white_highinc$noaction))

t.test(sh_white_lowinc$neveract + sh_white_lowinc$noaction,
       sh_white_highinc$neveract + sh_white_highinc$noaction)
100*(mean(sh_white_lowinc$neveract + sh_white_lowinc$noaction)
    - mean(sh_white_highinc$neveract + sh_white_highinc$noaction))

t.test(sh_minority_lowinc$neveract + sh_minority_lowinc$noaction,
       sh_white_highinc$neveract + sh_white_highinc$noaction)
100*(mean(sh_minority_lowinc$neveract + sh_minority_lowinc$noaction)
    - mean(sh_white_highinc$neveract + sh_white_highinc$noaction))

## Code to produce contents of our Table 8

## Compute proportions for neveract + noaction for Experiment 2
NeverNoActCountsGG <- c(sum(gg_control$neveract + gg_control$noaction),
                      sum(gg_white_highinc$neveract + gg_white_highinc$noaction),
                      sum(gg_minority_highinc$neveract + gg_minority_highinc$noaction),
                      sum(gg_white_lowinc$neveract + gg_white_lowinc$noaction),
                      sum(gg_minority_lowinc$neveract + gg_minority_lowinc$noaction))
SampleSizesGG <- c(length(gg_control$neveract + gg_control$noaction),
                   length(gg_white_highinc$neveract + gg_white_highinc$noaction),
                   length(gg_minority_highinc$neveract + gg_minority_highinc$noaction),
                   length(gg_white_lowinc$neveract + gg_white_lowinc$noaction),
                   length(gg_minority_lowinc$neveract + gg_minority_lowinc$noaction))
PctNeverNoActGG <- NeverNoActCountsGG/SampleSizesGG*100

## Comparison of means: Experiment 2 (Gender Pay Gap),
##   DV: Proportion "would NOT participate" + proportion "none of the above"
##    Comparing each of four treatments to ambiguous frame
t.test(gg_white_highinc$neveract + gg_white_highinc$noaction,
       gg_control$neveract + gg_control$noaction)
100*(mean(gg_white_highinc$neveract + gg_white_highinc$noaction)
    - mean(gg_control$neveract + gg_control$noaction))

t.test(gg_minority_highinc$neveract + gg_minority_highinc$noaction,
       gg_control$neveract + gg_control$noaction)
100*(mean(gg_minority_highinc$neveract + gg_minority_highinc$noaction)
    - mean(gg_control$neveract + gg_control$noaction))

t.test(gg_white_lowinc$neveract + gg_white_lowinc$noaction,
       gg_control$neveract + gg_control$noaction)
100*(mean(gg_white_lowinc$neveract + gg_white_lowinc$noaction)
    - mean(gg_control$neveract + gg_control$noaction))

t.test(gg_minority_lowinc$neveract + gg_minority_lowinc$noaction,
       gg_control$neveract + gg_control$noaction)
100*(mean(gg_minority_lowinc$neveract + gg_minority_lowinc$noaction)
    - mean(gg_control$neveract + gg_control$noaction))

## Comparison of means: Experiment 2 (Gender Pay Gap),
##   DV: Proportion "would NOT participate" + proportion "none of the above"
##    Comparing treatments 2, 3, and 4 to treatment 1
t.test(gg_minority_highinc$neveract + gg_minority_highinc$noaction,
       gg_white_highinc$neveract +  gg_white_highinc$noaction)
100*(mean(gg_minority_highinc$neveract + gg_minority_highinc$noaction)
    - mean(gg_white_highinc$neveract + gg_white_highinc$noaction))

t.test(gg_white_lowinc$neveract + gg_white_lowinc$noaction,
       gg_white_highinc$neveract + gg_white_highinc$noaction)
100*(mean(gg_white_lowinc$neveract + gg_white_lowinc$noaction)
    - mean(gg_white_highinc$neveract + gg_white_highinc$noaction))

t.test(gg_minority_lowinc$neveract + gg_minority_lowinc$noaction,
       gg_white_highinc$neveract + gg_white_highinc$noaction)
100*(mean(gg_minority_lowinc$neveract + gg_minority_lowinc$noaction)
    - mean(gg_white_highinc$neveract + gg_white_highinc$noaction))
